package com.wu.d1_math;


import javafx.beans.property.SimpleObjectProperty;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class data {
    public static void main(String[] args) {
        Date time = new Date();
        System.out.println(time);

        long time1 = time.getTime();
        System.out.println(time1);

        time1 +=2*1000;
        Date time2= new Date(time1);
        System.out.println(time2);

        Date d3 = new Date();
        d3.setTime(time1);
        System.out.println(d3);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss EEE a");
        System.out.println(sdf.format(d3));

        String dataStr ="2022-12-12 12:12:11";
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date date = sdf2.parse(dataStr);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}
